<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Open SCA: frameworks/File/src/File_impl.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.onetek.net"><img alt="Logo" src="openscaLogo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Open SCA
   &#160;<span id="projectnumber">Version 0.6.0</span>
   </div>
   <div id="projectbrief">Open SCA</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_file__impl_8cpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">File_impl.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_file__impl_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/***************************************************************************/</span><span class="comment">/****************************************************************************/</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &quot;../include/debug.h&quot;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="opensca_support_8h.html">openscaSupport.h</a>&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;../include/File_impl.h&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">//default constructor, its not implemented, so recommand not to  use it</span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_file__impl.html#a1fcae833f5b173403d06fe353da96cde">   38</a></span>&#160;<a class="code" href="class_file__impl.html#a1fcae833f5b173403d06fe353da96cde">File_impl::File_impl</a>() {</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;}</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="class_file__impl.html#a28a2b3f063e904bbdbcbd92219f6eae8">   42</a></span>&#160;<a class="code" href="class_file__impl.html#a1fcae833f5b173403d06fe353da96cde">File_impl::File_impl</a>(</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="class_file__impl.html#a2fb34edc76fc900779db733007cdd00d">fileName</a>,</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> * fspath,</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keywordtype">bool</span> readOnly,</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordtype">bool</span> create) {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;In constructor with&quot;</span> &lt;&lt; fileName</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;              &lt;&lt; <span class="stringliteral">&quot; and path:&quot;</span> &lt;&lt; fspath)</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="keywordflow">if</span> (!(<a class="code" href="namespaceopensca_support.html#ae9bb2b09b6f0afefe46747ac1eb72f8e">openscaSupport::isValidFileName</a>(fileName)</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;                &amp;&amp; <a class="code" href="namespaceopensca_support.html#ae9bb2b09b6f0afefe46747ac1eb72f8e">openscaSupport::isValidFileName</a>(fspath))) {</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;valid File name in File_impl constructor&quot;</span> )</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;                <span class="keywordflow">throw</span> CF::InvalidFileName(CF::CFEINVAL,</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                                          <span class="stringliteral">&quot;[File_impl::File_impl]invalid file name&quot;</span>);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="comment">//set file mode</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        std::ios_base::openmode mode;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="keywordflow">if</span> (create) {</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                mode = std::ios::in | std::ios::out | std::ios::trunc;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (readOnly) {</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                mode = std::ios::in;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                mode = std::ios::in | std::ios::out;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        }</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="comment">//full file path: fspath / fileName</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <a class="code" href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">m_fName</a> = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <a class="code" href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">m_fName</a>.append(fspath);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <a class="code" href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">m_fName</a>.append(<span class="stringliteral">&quot;/&quot;</span>);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <a class="code" href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">m_fName</a>.append(fileName);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(7, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;m_fName is &quot;</span> &lt;&lt; <a class="code" href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">m_fName</a>)</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.open(<a class="code" href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">m_fName</a>.c_str(), mode);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.is_open()) {</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(3, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;[File_impl::File_impl]open file failed&quot;</span>)</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                exit(EXIT_FAILURE);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        }</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;}</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_file__impl.html#a49b834254adbb460a7946edb6954b94a">   82</a></span>&#160;<a class="code" href="class_file__impl.html#a49b834254adbb460a7946edb6954b94a">File_impl::~File_impl</a>() {</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(5, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;Calling File_impl, deconstructor&quot;</span>)</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keywordtype">void</span></div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="class_file__impl.html#a5ae591df94fc66ccb85cbb6565368bca">   87</a></span>&#160;<a class="code" href="class_file__impl.html#a5ae591df94fc66ccb85cbb6565368bca">File_impl::close</a>()</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;throw (</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    CF::FileException,</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    CORBA::SystemException) {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.close();</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.fail()) {</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(2, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;[File_impl::close] Exception: close file failed&quot;</span>)</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        }</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;}</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="keywordtype">void</span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="class_file__impl.html#a2e2bd46a25135e422187a5440b2492a0">  102</a></span>&#160;<a class="code" href="class_file__impl.html#a2e2bd46a25135e422187a5440b2492a0">File_impl::read</a>(</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="namespace_j_t_r_s.html#a0f23e204265cab9b70e496e4db797de3">CF::OctetSequence_out</a> data,</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    CORBA::ULong length)</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="keywordflow">throw</span> (CF::File::IOException,</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;       CORBA::SystemException) {</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(6, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;entering into File_impl::read with length:&quot;</span> &lt;&lt; length)</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        CORBA::Octet* buf = CF::OctetSequence::allocbuf(length);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor">#if 0</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.seekg(0, ios::beg);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _cnt = <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.readsome((<span class="keywordtype">char</span>*)buf,</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                                          length);      <span class="comment">//notice: readsome fail to read file</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.read((<span class="keywordtype">char</span>*)buf, length);</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(6, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;read count:&quot;</span> &lt;&lt; <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.gcount())</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;#<span class="keywordflow">if</span> 0</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <span class="keywordflow">if</span> ( _cnt == 0) {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(3, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;read size is :&quot;</span> &lt;&lt; _cnt)</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                <span class="keywordflow">throw</span> CF::File::IOException(CF::CFEIO, <span class="stringliteral">&quot;[File_impl::read]read zero&quot;</span>);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        data = <span class="keyword">new</span> <a class="code" href="namespace_j_t_r_s.html#ae7847bbc4b95932f1b057cdd6c91d45b">CF::OctetSequence</a>(length, _cnt, buf, <span class="keyword">true</span>);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        data = <span class="keyword">new</span> <a class="code" href="namespace_j_t_r_s.html#ae7847bbc4b95932f1b057cdd6c91d45b">CF::OctetSequence</a>(<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.gcount(), <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.gcount(), buf, <span class="keyword">true</span>);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="preprocessor">#if 0</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.fail()) {</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(3, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;read file error&quot;</span>)</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                <span class="keywordflow">throw</span> CF::File::IOException(CF::CFEIO, <span class="stringliteral">&quot;[File_impl::read]read file error&quot;</span>);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        }</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(4, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;[File_impl::read] read end&quot;</span>)</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;}</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="keywordtype">void</span></div><div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="class_file__impl.html#adcb50f2c82d30fac17f8714fbeeeeb08">  137</a></span>&#160;<a class="code" href="class_file__impl.html#adcb50f2c82d30fac17f8714fbeeeeb08">File_impl::setFilePointer</a>(</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    CORBA::ULong _filePointer)</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="keywordflow">throw</span> (</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    CF::FileException, CF::File::InvalidFilePointer,</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    CORBA::SystemException) {</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(3, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;entering setFilePointer with _filePosinter=&quot;</span> &lt;&lt;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;              _filePointer)</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        <span class="keywordflow">if</span> (_filePointer &gt; this-&gt;<a class="code" href="class_file__impl.html#af74f43b2414f8c947bb58c1fb3d77c5f">sizeOf</a>()) {</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                <span class="keywordflow">throw</span> CF::File::InvalidFilePointer();</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        }</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        <span class="comment">//set position of input pointer</span></div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.seekg(_filePointer);</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        <span class="comment">//set position of output pointer</span></div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.seekp(_filePointer);</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.fail()) {</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                <span class="keywordflow">throw</span> CF::FileException(CF::CFEIO, <span class="stringliteral">&quot;set file pointer fail&quot;</span>);</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        }</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;}</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;CORBA::ULong</div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="class_file__impl.html#af74f43b2414f8c947bb58c1fb3d77c5f">  163</a></span>&#160;<a class="code" href="class_file__impl.html#af74f43b2414f8c947bb58c1fb3d77c5f">File_impl::sizeOf</a>()</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;throw (</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    CF::FileException,</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    CORBA::SystemException) {</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(3, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;entering sizeof()&quot;</span>)</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        CORBA::ULong fPos(0), fSize(0);</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        fPos = <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.tellg();</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <span class="comment">//notice: must use off inputparam, otherwise fail to get size</span></div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.seekg(0, ios::end);</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        fSize = <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.tellg();</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.seekg(fPos);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.fail()) {</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;                <span class="keywordflow">throw</span> CF::FileException(CF::CFEIO, <span class="stringliteral">&quot;get size of file error&quot;</span>);</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        }</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">return</span>  fSize;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;}</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="keywordtype">void</span></div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="class_file__impl.html#abedae68271fce255d9509577c809f086">  188</a></span>&#160;<a class="code" href="class_file__impl.html#abedae68271fce255d9509577c809f086">File_impl::write</a>(</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keyword">const</span> <a class="code" href="namespace_j_t_r_s.html#ae7847bbc4b95932f1b057cdd6c91d45b">CF::OctetSequence</a> &amp; data)</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="keywordflow">throw</span> (</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    CF::File::IOException,</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    CORBA::SystemException) {</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(3, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;entering File_impl::write&quot;</span>)</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        <a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.write((<span class="keyword">const</span> <span class="keywordtype">char</span>*)data.get_buffer(), data.length());</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">m_fstm</a>.fail()) {</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;                <a class="code" href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a>(2, <a class="code" href="class_file__impl.html">File_impl</a>, <span class="stringliteral">&quot;error writer file&quot;</span>)</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;                <span class="keywordflow">throw</span> CF::File::IOException(CF::CFEIO, <span class="stringliteral">&quot;error wrte file&quot;</span>);</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        }</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;}</div><div class="ttc" id="class_file__impl_html_adcb50f2c82d30fac17f8714fbeeeeb08"><div class="ttname"><a href="class_file__impl.html#adcb50f2c82d30fac17f8714fbeeeeb08">File_impl::setFilePointer</a></div><div class="ttdeci">void setFilePointer(CORBA::ULong _filePointer)</div><div class="ttdoc">The setFilePointer operation positions the file pointer where the next read or write will occur...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00137">File_impl.cpp:137</a></div></div>
<div class="ttc" id="namespace_j_t_r_s_html_ae7847bbc4b95932f1b057cdd6c91d45b"><div class="ttname"><a href="namespace_j_t_r_s.html#ae7847bbc4b95932f1b057cdd6c91d45b">JTRS::OctetSequence</a></div><div class="ttdeci">CF::OctetSequence OctetSequence</div><div class="ttdef"><b>Definition:</b> <a href="_j_t_r_s_corba_types_c_8h_source.html#l00148">JTRSCorbaTypesC.h:148</a></div></div>
<div class="ttc" id="class_file__impl_html_a5ae591df94fc66ccb85cbb6565368bca"><div class="ttname"><a href="class_file__impl.html#a5ae591df94fc66ccb85cbb6565368bca">File_impl::close</a></div><div class="ttdeci">void close()</div><div class="ttdoc">The close operation is needed in order to release file resources once they are no longer needed...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00087">File_impl.cpp:87</a></div></div>
<div class="ttc" id="class_file__impl_html_a755d2a2edec51d5c364101c7d1582a11"><div class="ttname"><a href="class_file__impl.html#a755d2a2edec51d5c364101c7d1582a11">File_impl::m_fstm</a></div><div class="ttdeci">std::fstream m_fstm</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8h_source.html#l00178">File_impl.h:178</a></div></div>
<div class="ttc" id="class_file__impl_html_a49b834254adbb460a7946edb6954b94a"><div class="ttname"><a href="class_file__impl.html#a49b834254adbb460a7946edb6954b94a">File_impl::~File_impl</a></div><div class="ttdeci">~File_impl()</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00082">File_impl.cpp:82</a></div></div>
<div class="ttc" id="debug_8h_html_a4036580c4cea6cf404647d18f2fe3452"><div class="ttname"><a href="debug_8h.html#a4036580c4cea6cf404647d18f2fe3452">DEBUG</a></div><div class="ttdeci">#define DEBUG(level, title, debuginfo)</div><div class="ttdef"><b>Definition:</b> <a href="debug_8h_source.html#l00055">debug.h:55</a></div></div>
<div class="ttc" id="opensca_support_8h_html"><div class="ttname"><a href="opensca_support_8h.html">openscaSupport.h</a></div><div class="ttdoc">:  </div></div>
<div class="ttc" id="class_file__impl_html_a2fb34edc76fc900779db733007cdd00d"><div class="ttname"><a href="class_file__impl.html#a2fb34edc76fc900779db733007cdd00d">File_impl::fileName</a></div><div class="ttdeci">char * fileName()</div><div class="ttdoc">The operation shall return the pathname used as the input fileName parameter of the FileSystem::creat...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8h_source.html#l00067">File_impl.h:67</a></div></div>
<div class="ttc" id="namespaceopensca_support_html_ae9bb2b09b6f0afefe46747ac1eb72f8e"><div class="ttname"><a href="namespaceopensca_support.html#ae9bb2b09b6f0afefe46747ac1eb72f8e">openscaSupport::isValidFileName</a></div><div class="ttdeci">bool isValidFileName(const char *fileName)</div><div class="ttdoc">check if filename is valid,Valid individual filenames and directory names shall be 40 characters or l...</div></div>
<div class="ttc" id="class_file__impl_html_a2e2bd46a25135e422187a5440b2492a0"><div class="ttname"><a href="class_file__impl.html#a2e2bd46a25135e422187a5440b2492a0">File_impl::read</a></div><div class="ttdeci">void read(CF::OctetSequence_out data, CORBA::ULong length)</div><div class="ttdoc">Applications require the read operation in order to retrieve data from remote files. </div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00102">File_impl.cpp:102</a></div></div>
<div class="ttc" id="namespace_j_t_r_s_html_a0f23e204265cab9b70e496e4db797de3"><div class="ttname"><a href="namespace_j_t_r_s.html#a0f23e204265cab9b70e496e4db797de3">JTRS::OctetSequence_out</a></div><div class="ttdeci">CF::OctetSequence_out OctetSequence_out</div><div class="ttdef"><b>Definition:</b> <a href="_j_t_r_s_corba_types_c_8h_source.html#l00150">JTRSCorbaTypesC.h:150</a></div></div>
<div class="ttc" id="class_file__impl_html_af74f43b2414f8c947bb58c1fb3d77c5f"><div class="ttname"><a href="class_file__impl.html#af74f43b2414f8c947bb58c1fb3d77c5f">File_impl::sizeOf</a></div><div class="ttdeci">CORBA::ULong sizeOf()</div><div class="ttdoc">An application may need to know the size of a file in order to determine memory allocation requiremen...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00163">File_impl.cpp:163</a></div></div>
<div class="ttc" id="class_file__impl_html_af8e266cbb595ab7f41a3ee5b4cb2715f"><div class="ttname"><a href="class_file__impl.html#af8e266cbb595ab7f41a3ee5b4cb2715f">File_impl::m_fName</a></div><div class="ttdeci">std::string m_fName</div><div class="ttdoc">The readonly fileName attribute shall contain the pathname used as the input fileName parameter of th...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8h_source.html#l00183">File_impl.h:183</a></div></div>
<div class="ttc" id="class_file__impl_html_a1fcae833f5b173403d06fe353da96cde"><div class="ttname"><a href="class_file__impl.html#a1fcae833f5b173403d06fe353da96cde">File_impl::File_impl</a></div><div class="ttdeci">File_impl()</div><div class="ttdoc">The File interface provides the ability to read and write files residing within a compliant...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00038">File_impl.cpp:38</a></div></div>
<div class="ttc" id="class_file__impl_html"><div class="ttname"><a href="class_file__impl.html">File_impl</a></div><div class="ttdoc">The File interface provides the ability to read and write files residing within a compliant...</div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8h_source.html#l00034">File_impl.h:34</a></div></div>
<div class="ttc" id="class_file__impl_html_abedae68271fce255d9509577c809f086"><div class="ttname"><a href="class_file__impl.html#abedae68271fce255d9509577c809f086">File_impl::write</a></div><div class="ttdeci">void write(const CF::OctetSequence &amp;data)</div><div class="ttdoc">Applications require the write operation in order to write data to remote files. </div><div class="ttdef"><b>Definition:</b> <a href="_file__impl_8cpp_source.html#l00188">File_impl.cpp:188</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_27e7b6da28153e106312658788f622d3.html">frameworks</a></li><li class="navelem"><a class="el" href="dir_7b7214e65a6924b84c23466be1b3e3d4.html">File</a></li><li class="navelem"><a class="el" href="dir_bfa40b2efcd20afac7a2bf72a3e48404.html">src</a></li><li class="navelem"><a class="el" href="_file__impl_8cpp.html">File_impl.cpp</a></li>
    <li class="footer">Generated on Fri Jul 12 2019 14:31:51 for
    <a href="http://www.onetek.net">
    <img class="footer" src="openscaLogo.png" height="31" alt="openSCA"/></a>
    </li>
  </ul>
</div>
</body>
</html>
